package zuoye07;

import java.util.HashMap;
import java.util.InputMismatchException;
import java.util.Scanner;

public class zuoye1 {
     public static void main(String[] args) throws  Exception{
          HashMap<String,Integer> aa=new HashMap<String,Integer>();
          Scanner sc=new Scanner(System.in);
          boolean c=true;

          while(c){

               try {
                    int a=sc.nextInt();
                    String b=sc.next();
                    if (a < 25 && a > 18) {
                         System.out.println("录入成功");
                         aa.put(b, a);
                         break;
                    }
               }
               catch (IllegalArgumentException |InputMismatchException e) {
                    System.out.println("录入失败亲重新输入");
                  sc.nextLine();
               }
          }
     }

}
